#include<iostream>
using namespace std;
int main(){
    int n,m;
    while (cin>>n>>m&&n<=100)
    {
        int a[100]={2,0};
        int x=0;
        for(int i=1;i<n;i++){
            a[i]=(i+1)*2;
        }
        int s=n,sum=0;
        while(s>=m){
        for(int i=0;i<m;i++){
            sum+=a[x];
            s--,x++;
        }
        cout<<sum/m;
        if(s>=m)cout<<" ";
        sum=0;
        }
        if(s<m&&s!=0){
            cout<<" ";
            for(int i=n-s;i<n;i++){
                sum+=a[i];
            }
            cout<<sum/s<<endl;
        }else{
            cout<<endl;
        }
        
    }
    
}